package com.genius.system.bo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;

@Data
@ApiModel(value = "修改用户信息BO", description = "从客户端，由用户传入的数据封装在此entity中")
public class UpdateUserBO {

    @NotNull(message = "用户ID不能为空")
    @Min(value = 1, message = "用户ID不能小于1")
    @ApiModelProperty(value = "用户ID")
    private Long userId;

    @Min(value = 1, message = "机构ID不能小于1")
    @ApiModelProperty(value = "机构ID")
    private Long deptId;

    @NotBlank(message = "姓名不能为空")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{2,10}$", message = "姓名不正确")
    @ApiModelProperty("姓名")
    private String name;

    @NotBlank(message = "性别不能为空")
    @Pattern(regexp = "^0$|^1$|^2$", message = "性别不正确")
    @ApiModelProperty("性别(0男，1女，2未知)")
    private String sex;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1\\d{10}$", message = "手机号不正确")
    @ApiModelProperty("手机号")
    private String phoneNumber;

    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱不正确")
    @ApiModelProperty("邮箱")
    private String email;

    @NotBlank(message = "状态不能为空")
    @Pattern(regexp = "^1$|^2$|^3$", message = "状态不正确")
    @ApiModelProperty("状态(1在职，2离职，3试用期)")
    private String status;

    @ApiModelProperty(value = "角色ID")
    private Long[] roleIds;
}

